import { Rule } from "./types";

export const LayoutRules: Rule[] = [
    {
        id: "Layout/AccessModifierIndentation",
        enabled: true,
        descEn: "Check indentation of private/protected visibility modifiers.",
        descCn: "",
        versionAdded: "0.49",
        paramList: [
            {
                param: "EnforcedStyle",
                defaultValue: "indent",
                optionList: ["outdent", "indent"],
            },
            {
                param: "IndentationWidth",
                defaultValue: null,
                demoValue: 1,
            }
        ],
        url: "https://docs.rubocop.org/rubocop/1.50/cops_layout.html#layoutaccessmodifierindentation",
    },
    {
        id: "Layout/ArgumentAlignment",
        enabled: true,
        descEn: "Align the arguments of a method call if they span more than one line.",
        descCn: "",
        versionAdded: "0.68",
        versionChanged: "0.77",
        paramList: [
            {
                param: "EnforcedStyle",
                defaultValue: "with_first_argument",
                optionList: ["with_first_argument", "with_fixed_indentation"],
            },
            {
                param: "IndentationWidth",
                defaultValue: null,
                demoValue: 1,
            }
        ],
        url: "https://docs.rubocop.org/rubocop/1.50/cops_layout.html#layoutargumentalignment",
    },
    {
        id: "Layout/ArrayAlignment",
        enabled: true,
        descEn: "Align the elements of an array literal if they span more than one line",
        descCn: "",
        versionAdded: "0.49",
        versionChanged: "0.77",
        paramList: [
            {
                param: "EnforcedStyle",
                defaultValue: "with_first_element",
                optionList: ["with_first_element", "with_fixed_indentation"],
            },
            {
                param: "IndentationWidth",
                defaultValue: null,
                demoValue: 1,
            }
        ],
        url: "https://docs.rubocop.org/rubocop/1.50/cops_layout.html#layoutarrayalignment",
    },
    {
        id: "Layout/AssignmentIndentation",
        enabled: true,
        descEn: "Checks the indentation of the first line of the right-hand-side of a multi-line assignment.",
        descCn: "",
        versionAdded: "0.49",
        versionChanged: "1.45",
        paramList: [
            {
                param: "IndentationWidth",
                defaultValue: null,
                demoValue: 1,
            }
        ],
        url: "https://docs.rubocop.org/rubocop/1.50/cops_layout.html#layoutassignmentindentation",
    },
    {
        id: "Layout/BeginEndAlignment",
        enabled: true,
        descEn: "Align ends corresponding to begins correctly.",
        descCn: "",
        versionAdded: "0.91",
        paramList: [
            {
                param: "EnforcedStyleAlignWith",
                defaultValue: "start_of_line",
                optionList: ["start_of_line", "begin"],
            },
            {
                param: "Severity",
                defaultValue: "warning",
                optionList: ["info", "refactor", "convention", "warning", "error", "fatal"],
            },
        ],
        url: "https://docs.rubocop.org/rubocop/1.50/cops_layout.html#layoutbeginendalignment",
    },
    {
        id: "Layout/BlockAlignment",
        enabled: true,
        descEn: "Align block ends correctly.",
        descCn: "",
        versionAdded: "0.53",
        paramList: [
            {
                param: "EnforcedStyleAlignWith",
                defaultValue: "either",
                optionList: ["either", "start_of_block", "start_of_line"],
            }
        ],
        url: "https://docs.rubocop.org/rubocop/1.50/cops_layout.html#layoutblockalignment",
    },
    {
        id: "Layout/BlockEndNewline",
        enabled: true,
        descEn: "Put end statement of multiline block on its own line.",
        descCn: "",
        versionAdded: "0.49",
        paramList: [],
        url: "https://docs.rubocop.org/rubocop/1.50/cops_layout.html#layoutblockendnewline",
    },
    {
        id: "Layout/CaseIndentation",
        enabled: true,
        descEn: "Indentation of when in a case/(when|in)/[else/]end.",
        descCn: "",
        versionAdded: "0.49",
        versionChanged: "1.16",
        paramList: [
            {
                param: "EnforcedStyle",
                defaultValue: "case",
                optionList: ["case", "end"],
            },
            {
                param: "IndentOneStep",
                defaultValue: false,
            },
            {
                param: "IndentationWidth",
                defaultValue: null,
                demoValue: 1,
            }
        ],
        url: "https://docs.rubocop.org/rubocop/1.50/cops_layout.html#layoutcaseindentation",
    },
    {
        id: "Layout/ClassStructure",
        enabled: false,
        descEn: "Enforces a configured order of definitions within a class body.",
        descCn: "",
        versionAdded: "0.52",
        paramList: [
            {
                param: "Categories",
                defaultValue: {
                    "module_inclusion": ["include", "prepend", "extend"],
                },
                validValue: (value: unknown) => {
                    if (typeof value !== "object") {
                        return "值必须是一个对象";
                    }
                    for (const [k, v] of Object.entries(value as Object)) {
                        if (!["association", "attribute_macros", "macros", "module_inclusion"].includes(k)) {
                            return "对象键可选值是association,attribute_macros,macros,module_inclusion";
                        }
                        if (!Array.isArray(v)) {
                            return "对象键值必须是字符串数组";
                        }
                        if (k == "association") {
                            for (const av of v) {
                                if (typeof av != "string") {
                                    return "对象键值必须是字符串数组";
                                }
                                if (!["has_many", "has_one"].includes(av)) {
                                    return "association数组可选值是has_many,has_one";
                                }
                            }
                        } else if (k == "attribute_macros") {
                            for (const av of v) {
                                if (typeof av != "string") {
                                    return "对象键值必须是字符串数组";
                                }
                                if (!["attr_accessor", "attr_reader", "attr_writer"].includes(av)) {
                                    return "attribute_macros数组可选值是attr_accessor,attr_reader,attr_writer";
                                }
                            }
                        } else if (k == "macros") {
                            for (const av of v) {
                                if (typeof av != "string") {
                                    return "对象键值必须是字符串数组";
                                }
                                if (!["validates", "validate"].includes(av)) {
                                    return "macros数组可选值是validates,validate";
                                }
                            }
                        } else if (k == "module_inclusion") {
                            for (const av of v) {
                                if (typeof av != "string") {
                                    return "对象键值必须是字符串数组";
                                }
                                if (!["include", "prepend", "extend"].includes(av)) {
                                    return "module_inclusion数组可选值是include,prepend,extend";
                                }
                            }
                        }
                    }
                    return null;
                },
            },
            {
                param: "ExpectedOrder",
                defaultValue: ["module_inclusion", "constants", "public_class_methods", "initializer", "public_methods", "protected_methods", "private_methods"],
                optionList: ["module_inclusion", "constants", "association", "public_attribute_macros", "public_delegate", "macros", "public_class_methods", "initializer", "public_methods", "protected_attribute_macros", "protected_methods", "private_attribute_macros", "private_delegate", "private_methods"],
            }
        ],
        url: "https://docs.rubocop.org/rubocop/1.50/cops_layout.html#layoutclassstructure",
    },
    {
        id: "Layout/ClosingHeredocIndentation",
        enabled: true,
        descEn: "Checks the indentation of here document closings.",
        descCn: "",
        versionAdded: "0.57",
        paramList: [],
        url: "https://docs.rubocop.org/rubocop/1.50/cops_layout.html#layoutclosingheredocindentation",
    },
    {
        id: "Layout/ClosingParenthesisIndentation",
        enabled: false,
        descEn: "Checks the indentation of hanging closing parentheses.",
        descCn: "",
        versionAdded: "0.49",
        paramList: [],
        url: "https://docs.rubocop.org/rubocop/1.50/cops_layout.html#layoutclosingparenthesisindentation",
    },
    {
        id: "Layout/CommentIndentation",
        enabled: true,
        descEn: "Indentation of comments.",
        descCn: "",
        versionAdded: "0.49",
        versionChanged: "1.24",
        paramList: [
            {
                param: "AllowForAlignment",
                defaultValue: false,
            },
        ],
        url: "https://docs.rubocop.org/rubocop/1.50/cops_layout.html#layoutcommentindentation",
    },
    {
        id: "Layout/ConditionPosition",
        enabled: true,
        descEn: "Checks for condition placed in a confusing position relative to the keyword.",
        descCn: "",
        versionAdded: "0.53",
        versionChanged: "0.83",
        paramList: [],
        url: "https://docs.rubocop.org/rubocop/1.50/cops_layout.html#layoutconditionposition",
    },
    {
        id: "Layout/DefEndAlignment",
        enabled: true,
        descEn: "Align ends corresponding to defs correctly.",
        descCn: "",
        versionAdded: "0.53",
        paramList: [
            {
                param: "EnforcedStyleAlignWith",
                defaultValue: "start_of_line",
                optionList: ["start_of_line", "def"],
            },
            {
                param: "Severity",
                defaultValue: "warning",
                optionList: ["info", "refactor", "convention", "warning", "error", "fatal"],
            },
        ],
        url: "https://docs.rubocop.org/rubocop/1.50/cops_layout.html#layoutdefendalignment",
    },
    {
        id: "Layout/DotPosition",
        enabled: true,
        descEn: "Checks the position of the dot in multi-line method calls.",
        descCn: "",
        versionAdded: "0.49",
        paramList: [
            {
                param: "EnforcedStyle",
                defaultValue: "leading",
                optionList: ["leading", "trailing"],
            }
        ],
        url: "https://docs.rubocop.org/rubocop/1.50/cops_layout.html#layoutdotposition",
    },
    {
        id: "Layout/ElseAlignment",
        enabled: true,
        descEn: "Align elses and elsifs correctly.",
        descCn: "",
        versionAdded: "0.49",
        paramList: [],
        url: "https://docs.rubocop.org/rubocop/1.50/cops_layout.html#layoutelsealignment",
    },
    {
        id: "Layout/EmptyComment",
        enabled: true,
        descEn: "Checks empty comment.",
        descCn: "",
        versionAdded: "0.53",
        paramList: [
            {
                param: "AllowBorderComment",
                defaultValue: true,
            },
            {
                param: "AllowMarginComment",
                defaultValue: true,
            }
        ],
        url: "https://docs.rubocop.org/rubocop/1.50/cops_layout.html#layoutemptycomment",
    },
    {
        id: "Layout/EmptyLineAfterGuardClause",
        enabled: true,
        descEn: "Add empty line after guard clause.",
        descCn: "",
        versionAdded: "0.56",
        versionChanged: "0.59",
        paramList: [],
        url: "https://docs.rubocop.org/rubocop/1.50/cops_layout.html#layoutemptylineafterguardclause",
    },
    {
        id: "Layout/EmptyLineAfterMagicComment",
        enabled: true,
        descEn: "Add an empty line after magic comments to separate them from code.",
        descCn: "",
        versionAdded: "0.49",
        paramList: [],
        url: "https://docs.rubocop.org/rubocop/1.50/cops_layout.html#layoutemptylineaftermagiccomment",
    },
    {
        id: "Layout/EmptyLineAfterMultilineCondition",
        enabled: false,
        descEn: "Enforces empty line after multiline condition.",
        descCn: "",
        versionAdded: "0.90",
        paramList: [],
        url: "https://docs.rubocop.org/rubocop/1.50/cops_layout.html#layoutemptylineaftermultilinecondition",
    },
    {
        id: "Layout/EmptyLineBetweenDefs",
        enabled: true,
        descEn: "Use empty lines between class/module/method defs.",
        descCn: "",
        versionAdded: "0.49",
        versionChanged: "1.23",
        paramList: [
            {
                param: "EmptyLineBetweenMethodDefs",
                defaultValue: true,
            },
            {
                param: "EmptyLineBetweenClassDefs",
                defaultValue: true,
            },
            {
                param: "EmptyLineBetweenModuleDefs",
                defaultValue: true,
            },
            {
                param: "AllowAdjacentOneLineDefs",
                defaultValue: true,
            },
            {
                param: "NumberOfEmptyLines",
                defaultValue: 1,
            }
        ],
        url: "https://docs.rubocop.org/rubocop/1.50/cops_layout.html#layoutemptylinebetweendefs",
    },
    {
        id: "Layout/EmptyLines",
        enabled: true,
        descEn: "Don't use several empty lines in a row.",
        descCn: "",
        versionAdded: "0.49",
        paramList: [],
        url: "https://docs.rubocop.org/rubocop/1.50/cops_layout.html#layoutemptylines",
    },
    {
        id: "Layout/EmptyLinesAroundAccessModifier",
        enabled: true,
        descEn: "Keep blank lines around access modifiers.",
        descCn: "",
        versionAdded: "0.49",
        paramList: [
            {
                param: "EnforcedStyle",
                defaultValue: "around",
                optionList: ["around", "only_before"],
            }
        ],
        url: "https://docs.rubocop.org/rubocop/1.50/cops_layout.html#layoutemptylinesaroundaccessmodifier",
    },
    {
        id: "Layout/EmptyLinesAroundArguments",
        enabled: true,
        descEn: "Keeps track of empty lines around method arguments.",
        descCn: "",
        versionAdded: "0.52",
        paramList: [],
        url: "https://docs.rubocop.org/rubocop/1.50/cops_layout.html#layoutemptylinesaroundarguments",
    },
    {
        id: "Layout/EmptyLinesAroundAttributeAccessor",
        enabled: true,
        descEn: "Keep blank lines around attribute accessors.",
        descCn: "",
        versionAdded: "0.83",
        versionChanged: "0.84",
        paramList: [
            {
                param: "AllowAliasSyntax",
                defaultValue: true,
            },
            {
                param: "AllowedMethods",
                defaultValue: ["alias_method", "public", "protected", "private"],
                optionList: ["alias_method", "public", "protected", "private"],
            }
        ],
        url: "https://docs.rubocop.org/rubocop/1.50/cops_layout.html#layoutemptylinesaroundattributeaccessor",
    },
    {
        id: "Layout/EmptyLinesAroundBeginBody",
        enabled: true,
        descEn: "Keeps track of empty lines around begin-end bodies.",
        descCn: "",
        versionAdded: "0.49",
        paramList: [],
        url: "https://docs.rubocop.org/rubocop/1.50/cops_layout.html#layoutemptylinesaroundbeginbody",
    },
    {
        id: "Layout/EmptyLinesAroundBlockBody",
        enabled: true,
        descEn: "Keeps track of empty lines around block bodies.",
        descCn: "",
        versionAdded: "0.49",
        paramList: [
            {
                param: "EnforcedStyle",
                defaultValue: "no_empty_lines",
                optionList: ["empty_lines", "no_empty_lines"],
            },
        ],
        url: "https://docs.rubocop.org/rubocop/1.50/cops_layout.html#layoutemptylinesaroundblockbody",
    },
    {
        id: "Layout/EmptyLinesAroundClassBody",
        enabled: true,
        descEn: "Keeps track of empty lines around class bodies.",
        descCn: "",
        versionAdded: "0.49",
        versionChanged: "0.53",
        paramList: [
            {
                param: "EnforcedStyle",
                defaultValue: "no_empty_lines",
                optionList: ["empty_lines", "empty_lines_except_namespace", "empty_lines_special", "no_empty_lines", "beginning_only", "ending_only"],
            }
        ],
        url: "https://docs.rubocop.org/rubocop/1.50/cops_layout.html#layoutemptylinesaroundclassbody",
    },
    {
        id: "Layout/EmptyLinesAroundExceptionHandlingKeywords",
        enabled: true,
        descEn: "Keeps track of empty lines around exception handling keywords.",
        descCn: "",
        versionAdded: "0.49",
        paramList: [],
        url: "https://docs.rubocop.org/rubocop/1.50/cops_layout.html#layoutemptylinesaroundexceptionhandlingkeywords",
    },
    {
        id: "Layout/EmptyLinesAroundMethodBody",
        enabled: true,
        descEn: "Keeps track of empty lines around method bodies.",
        descCn: "",
        versionAdded: "0.49",
        paramList: [],
        url: "https://docs.rubocop.org/rubocop/1.50/cops_layout.html#layoutemptylinesaroundmethodbody",
    },
    {
        id: "Layout/EmptyLinesAroundModuleBody",
        enabled: true,
        descEn: "Keeps track of empty lines around module bodies.",
        descCn: "",
        versionAdded: "0.49",
        paramList: [
            {
                param: "EnforcedStyle",
                defaultValue: "no_empty_lines",
                optionList: ["empty_lines", "empty_lines_except_namespace", "empty_lines_special", "no_empty_lines"],
            },
        ],
        url: "https://docs.rubocop.org/rubocop/1.50/cops_layout.html#layoutemptylinesaroundmodulebody",
    },
    {
        id: "Layout/EndAlignment",
        enabled: true,
        descEn: "Align ends correctly.",
        descCn: "",
        versionAdded: "0.53",
        paramList: [
            {
                param: "EnforcedStyleAlignWith",
                defaultValue: "keyword",
                optionList: ["keyword", "variable", "start_of_line"],
            },
            {
                param: "Severity",
                defaultValue: "warning",
                optionList: ["info", "refactor", "convention", "warning", "error", "fatal"],
            },
        ],
        url: "https://docs.rubocop.org/rubocop/1.50/cops_layout.html#layoutendalignment",
    },
    {
        id: "Layout/EndOfLine",
        enabled: true,
        descEn: "Use Unix-style line endings.",
        descCn: "",
        versionAdded: "0.49",
        paramList: [
            {
                param: "EnforcedStyle",
                defaultValue: "native",
                optionList: ["native", "lf", "crlf"],
            }
        ],
        url: "https://docs.rubocop.org/rubocop/1.50/cops_layout.html#layoutendofline",
    },
    {
        id: "Layout/ExtraSpacing",
        enabled: true,
        descEn: "Do not use unnecessary spacing.",
        descCn: "",
        versionAdded: "0.49",
        paramList: [
            {
                param: "AllowForAlignment",
                defaultValue: true,
            },
            {
                param: "AllowBeforeTrailingComments",
                defaultValue: false,
            },
            {
                param: "ForceEqualSignAlignment",
                defaultValue: false,
            }
        ],
        url: "https://docs.rubocop.org/rubocop/1.50/cops_layout.html#layoutextraspacing",
    },
    {
        id: "Layout/FirstArgumentIndentation",
        enabled: true,
        descEn: "Checks the indentation of the first argument in a method call.",
        descCn: "",
        versionAdded: "0.68",
        versionChanged: "0.77",
        paramList: [
            {
                param: "EnforcedStyle",
                defaultValue: "special_for_inner_method_call_in_parentheses",
                optionList: ["consistent", "consistent_relative_to_receiver", "special_for_inner_method_call", "special_for_inner_method_call_in_parentheses"],
            },
            {
                param: "IndentationWidth",
                defaultValue: null,
                demoValue: 1,
            }
        ],
        url: "https://docs.rubocop.org/rubocop/1.50/cops_layout.html#layoutfirstargumentindentation",
    },
    {
        id: "Layout/FirstArrayElementIndentation",
        enabled: true,
        descEn: "Checks the indentation of the first element in an array literal.",
        descCn: "",
        versionAdded: "0.68",
        versionChanged: "0.77",
        paramList: [
            {
                param: "EnforcedStyle",
                defaultValue: "special_inside_parentheses",
                optionList: ["special_inside_parentheses", "consistent", "align_brackets"],
            },
            {
                param: "IndentationWidth",
                defaultValue: null,
                demoValue: 1,
            },
        ],
        url: "https://docs.rubocop.org/rubocop/1.50/cops_layout.html#layoutfirstarrayelementindentation",
    },
    {
        id: "Layout/FirstArrayElementLineBreak",
        enabled: false,
        descEn: "Checks for a line break before the first element in a multi-line array.",
        descCn: "",
        versionAdded: "0.49",
        paramList: [
            {
                param: "AllowMultilineFinalElement",
                defaultValue: false,
            }
        ],
        url: "https://docs.rubocop.org/rubocop/1.50/cops_layout.html#layoutfirstarrayelementlinebreak",
    },
    {
        id: "Layout/FirstHashElementIndentation",
        enabled: true,
        descEn: "Checks the indentation of the first key in a hash literal.",
        descCn: "",
        versionAdded: "0.68",
        versionChanged: "0.77",
        paramList: [
            {
                param: "EnforcedStyle",
                defaultValue: "special_inside_parentheses",
                optionList: ["special_inside_parentheses", "consistent", "align_braces"],
            },
            {
                param: "IndentationWidth",
                defaultValue: null,
                demoValue: 1,
            }
        ],
        url: "https://docs.rubocop.org/rubocop/1.50/cops_layout.html#layoutfirsthashelementindentation",
    },
    {
        id: "Layout/FirstHashElementLineBreak",
        enabled: false,
        descEn: "Checks for a line break before the first element in a multi-line hash.",
        descCn: "",
        versionAdded: "0.49",
        paramList: [
            {
                param: "AllowMultilineFinalElement",
                defaultValue: false,
            }
        ],
        url: "https://docs.rubocop.org/rubocop/1.50/cops_layout.html#layoutfirsthashelementlinebreak",
    },
    {
        id: "Layout/FirstMethodArgumentLineBreak",
        enabled: false,
        descEn: "Checks for a line break before the first argument in a multi-line method call.",
        descCn: "",
        versionAdded: "0.49",
        paramList: [
            {
                param: "AllowMultilineFinalElement",
                defaultValue: false,
            }
        ],
        url: "https://docs.rubocop.org/rubocop/1.50/cops_layout.html#layoutfirstmethodargumentlinebreak",
    },
    {
        id: "Layout/FirstMethodParameterLineBreak",
        enabled: false,
        descEn: "Checks for a line break before the first parameter in a multi-line method parameter definition.",
        descCn: "",
        versionAdded: "0.49",
        paramList: [
            {
                param: "AllowMultilineFinalElement",
                defaultValue: false,
            }
        ],
        url: "https://docs.rubocop.org/rubocop/1.50/cops_layout.html#layoutfirstmethodparameterlinebreak",
    },
    {
        id: "Layout/FirstParameterIndentation",
        enabled: true,
        descEn: "Checks the indentation of the first parameter in a method definition.",
        descCn: "",
        versionAdded: "0.49",
        versionChanged: "0.77",
        paramList: [
            {
                param: "EnforcedStyle",
                defaultValue: "consistent",
                optionList: ["consistent", "align_parentheses"],
            }
        ],
        url: "https://docs.rubocop.org/rubocop/1.50/cops_layout.html#layoutfirstparameterindentation",
    },
    {
        id: "Layout/HashAlignment",
        enabled: true,
        descEn: "Align the elements of a hash literal if they span more than one line.",
        descCn: "",
        versionAdded: "0.49",
        versionChanged: "1.16",
        paramList: [
            {
                param: "EnforcedHashRocketStyle",
                defaultValue: "key",
                optionList: ["key", "separator", "table"],
            },
            {
                param: "EnforcedColonStyle",
                defaultValue: "key",
                optionList: ["key", "separator", "table"],
            },
            {
                param: "EnforcedLastArgumentHashStyle",
                defaultValue: "always_inspect",
                optionList: ["always_inspect", "always_ignore", "ignore_implicit", "ignore_explicit"],
            },
        ],
        url: "https://docs.rubocop.org/rubocop/1.50/cops_layout.html#layouthashalignment",
    },
    {
        id: "Layout/HeredocArgumentClosingParenthesis",
        enabled: false,
        descEn: "Checks for the placement of the closing parenthesis in a method call that passes a HEREDOC string as an argument.",
        descCn: "",
        versionAdded: "0.68",
        paramList: [],
        url: "https://docs.rubocop.org/rubocop/1.50/cops_layout.html#layoutheredocargumentclosingparenthesis",
    },
    {
        id: "Layout/HeredocIndentation",
        enabled: true,
        descEn: "Checks the indentation of the here document bodies.",
        descCn: "",
        versionAdded: "0.49",
        versionChanged: "0.85",
        paramList: [],
        url: "https://docs.rubocop.org/rubocop/1.50/cops_layout.html#layoutheredocindentation",
    },
    {
        id: "Layout/IndentationConsistency",
        enabled: true,
        descEn: "Keep indentation straight.",
        descCn: "",
        versionAdded: "0.49",
        paramList: [
            {
                param: "EnforcedStyle",
                defaultValue: "normal",
                optionList: ["normal", "indented_internal_methods"],
            },
        ],
        url: "https://docs.rubocop.org/rubocop/1.50/cops_layout.html#layoutindentationconsistency",
    },
    {
        id: "Layout/IndentationStyle",
        enabled: true,
        descEn: "Consistent indentation either with tabs only or spaces only.",
        descCn: "",
        versionAdded: "0.49",
        versionChanged: "0.82",
        paramList: [
            {
                param: "EnforcedStyle",
                defaultValue: "spaces",
                optionList: ["spaces", "tabs"],
            },
            {
                param: "IndentationWidth",
                defaultValue: null,
                demoValue: 1,
            }
        ],
        url: "https://docs.rubocop.org/rubocop/1.50/cops_layout.html#layoutindentationstyle",
    },
    {
        id: "Layout/IndentationWidth",
        enabled: true,
        descEn: "Use 2 spaces for indentation.",
        descCn: "",
        versionAdded: "0.49",
        paramList: [
            {
                param: "Width",
                defaultValue: 2,
            },
            {
                param: "AllowedPatterns",
                defaultValue: [],
            }
        ],
        url: "https://docs.rubocop.org/rubocop/1.50/cops_layout.html#layoutindentationwidth",
    },
    {
        id: "Layout/InitialIndentation",
        enabled: true,
        descEn: "Checks the indentation of the first non-blank non-comment line in a file.",
        descCn: "",
        versionAdded: "0.49",
        paramList: [],
        url: "https://docs.rubocop.org/rubocop/1.50/cops_layout.html#layoutinitialindentation",
    },
    {
        id: "Layout/LeadingCommentSpace",
        enabled: true,
        descEn: "Comments should start with a space",
        descCn: "",
        versionAdded: "0.49",
        versionChanged: "0.73",
        paramList: [
            {
                param: "AllowDoxygenCommentStyle",
                defaultValue: false,
            },
            {
                param: "AllowGemfileRubyComment",
                defaultValue: false,
            }
        ],
        url: "https://docs.rubocop.org/rubocop/1.50/cops_layout.html#layoutleadingcommentspace",
    },
    {
        id: "Layout/LeadingEmptyLines",
        enabled: true,
        descEn: "Check for unnecessary blank lines at the beginning of a file.",
        descCn: "",
        versionAdded: "0.57",
        versionChanged: "0.77",
        paramList: [],
        url: "https://docs.rubocop.org/rubocop/1.50/cops_layout.html#layoutleadingemptylines",
    },
    {
        id: "Layout/LineContinuationLeadingSpace",
        enabled: "pending",
        descEn: "Use trailing spaces instead of leading spaces in strings broken over multiple lines (by a backslash).",
        descCn: "",
        versionAdded: "1.31",
        versionChanged: "1.45",
        paramList: [
            {
                param: "EnforcedStyle",
                defaultValue: "trailing",
                optionList: ["leading", "trailing"],
            }
        ],
        url: "https://docs.rubocop.org/rubocop/1.50/cops_layout.html#layoutlinecontinuationleadingspace",
    },
    {
        id: "Layout/LineContinuationSpacing",
        enabled: "pending",
        descEn: "Checks the spacing in front of backslash in line continuations.",
        descCn: "",
        versionAdded: "1.31",
        paramList: [
            {
                param: "EnforcedStyle",
                defaultValue: "space",
                optionList: ["space", "no_space"],
            }
        ],
        url: "https://docs.rubocop.org/rubocop/1.50/cops_layout.html#layoutlinecontinuationspacing",
    },
    {
        id: "Layout/LineEndStringConcatenationIndentation",
        enabled: "pending",
        descEn: "Checks the indentation of the next line after a line that ends with a string literal and a backslash.",
        descCn: "",
        versionAdded: "1.18",
        paramList: [
            {
                param: "EnforcedStyle",
                defaultValue: "aligned",
                optionList: ["aligned", "indented"],
            },
            {
                param: "IndentationWidth",
                defaultValue: null,
                demoValue: 1,
            }
        ],
        url: "https://docs.rubocop.org/rubocop/1.50/cops_layout.html#layoutlineendstringconcatenationindentation",
    },
    {
        id: "Layout/LineLength",
        enabled: true,
        descEn: "Checks that line length does not exceed the configured limit.",
        descCn: "",
        versionAdded: "0.25",
        versionChanged: "1.4",
        paramList: [
            {
                param: "Max",
                defaultValue: 120,
            },
            {
                param: "AllowHeredoc",
                defaultValue: true,
            },
            {
                param: "AllowURI",
                defaultValue: true,
            },
            {
                param: "URISchemes",
                defaultValue: ["http", "https"],
                optionList: ["http", "https"],
            },
            {
                param: "IgnoreCopDirectives",
                defaultValue: true,
            },
            {
                param: "AllowedPatterns",
                defaultValue: [],
            }
        ],
        url: "https://docs.rubocop.org/rubocop/1.50/cops_layout.html#layoutlinelength",
    },
    {
        id: "Layout/MultilineArrayBraceLayout",
        enabled: true,
        descEn: "Checks that the closing brace in an array literal is either on the same line as the last array element, or a new line.",
        descCn: "",
        versionAdded: "0.49",
        paramList: [
            {
                param: "EnforcedStyle",
                defaultValue: "symmetrical",
                optionList: ["symmetrical", "new_line", "same_line"],
            }
        ],
        url: "https://docs.rubocop.org/rubocop/1.50/cops_layout.html#layoutmultilinearraybracelayout",
    },
    {
        id: "Layout/MultilineArrayLineBreaks",
        enabled: false,
        descEn: "Checks that each item in a multi-line array literal starts on a separate line.",
        descCn: "",
        versionAdded: "0.67",
        paramList: [
            {
                param: "AllowMultilineFinalElement",
                defaultValue: false,
            }
        ],
        url: "https://docs.rubocop.org/rubocop/1.50/cops_layout.html#layoutmultilinearraylinebreaks",
    },
    {
        id: "Layout/MultilineAssignmentLayout",
        enabled: false,
        descEn: "Check for a newline after the assignment operator in multi-line assignments.",
        descCn: "",
        versionAdded: "0.49",
        paramList: [
            {
                param: "EnforcedStyle",
                defaultValue: "new_line",
                optionList: ["same_line", "new_line"],
            }
        ],
        url: "https://docs.rubocop.org/rubocop/1.50/cops_layout.html#layoutmultilineassignmentlayout",
    },
    {
        id: "Layout/MultilineBlockLayout",
        enabled: true,
        descEn: "Ensures newlines after multiline block do statements.",
        descCn: "",
        versionAdded: "0.49",
        paramList: [],
        url: "https://docs.rubocop.org/rubocop/1.50/cops_layout.html#layoutmultilineblocklayout",
    },
    {
        id: "Layout/MultilineHashBraceLayout",
        enabled: true,
        descEn: "Checks that the closing brace in a hash literal is either on the same line as the last hash element, or a new line.",
        descCn: "",
        versionAdded: "0.49",
        paramList: [
            {
                param: "EnforcedStyle",
                defaultValue: "symmetrical",
                optionList: ["symmetrical", "new_line", "same_line"],
            }

        ],
        url: "https://docs.rubocop.org/rubocop/1.50/cops_layout.html#layoutmultilinehashbracelayout",
    },
    {
        id: "Layout/MultilineHashKeyLineBreaks",
        enabled: false,
        descEn: "Checks that each item in a multi-line hash literal starts on a separate line.",
        descCn: "",
        versionAdded: "0.67",
        versionChanged: "",
        paramList: [
            {
                param: "AllowMultilineFinalElement",
                defaultValue: false,
            }
        ],
        url: "https://docs.rubocop.org/rubocop/1.50/cops_layout.html#layoutmultilinehashkeylinebreaks",
    },
    {
        id: "Layout/MultilineMethodArgumentLineBreaks",
        enabled: false,
        descEn: "Checks that each argument in a multi-line method call starts on a separate line.",
        descCn: "",
        versionAdded: "0.67",
        paramList: [
            {
                param: "AllowMultilineFinalElement",
                defaultValue: false,
            }
        ],
        url: "https://docs.rubocop.org/rubocop/1.50/cops_layout.html#layoutmultilinemethodargumentlinebreaks",
    },
    {
        id: "Layout/MultilineMethodCallBraceLayout",
        enabled: true,
        descEn: "Checks that the closing brace in a method call is either on the same line as the last method argument, or a new line.",
        descCn: "",
        versionAdded: "0.49",
        paramList: [
            {
                param: "EnforcedStyle",
                defaultValue: "symmetrical",
                optionList: ["symmetrical", "new_line", "same_line"],
            }
        ],
        url: "https://docs.rubocop.org/rubocop/1.50/cops_layout.html#layoutmultilinemethodcallbracelayout",
    },
    {
        id: "Layout/MultilineMethodCallIndentation",
        enabled: true,
        descEn: "Checks indentation of method calls with the dot operator that span more than one line.",
        descCn: "",
        versionAdded: "0.49",
        paramList: [
            {
                param: "EnforcedStyle",
                defaultValue: "aligned",
                optionList: ["aligned", "indented", "indented_relative_to_receiver"],
            },
            {
                param: "IndentationWidth",
                defaultValue: null,
                demoValue: 1,
            }
        ],
        url: "https://docs.rubocop.org/rubocop/1.50/cops_layout.html#layoutmultilinemethodcallindentation",
    },
    {
        id: "Layout/MultilineMethodDefinitionBraceLayout",
        enabled: true,
        descEn: "Checks that the closing brace in a method definition is either on the same line as the last method parameter, or a new line.",
        descCn: "",
        versionAdded: "0.49",
        paramList: [
            {
                param: "EnforcedStyle",
                defaultValue: "symmetrical",
                optionList: ["symmetrical", "new_line", "same_line"],
            }
        ],
        url: "https://docs.rubocop.org/rubocop/1.50/cops_layout.html#layoutmultilinemethoddefinitionbracelayout",
    },
    {
        id: "Layout/MultilineMethodParameterLineBreaks",
        enabled: false,
        descEn: "Checks that each parameter in a multi-line method definition starts on a separate line.",
        descCn: "",
        versionAdded: "1.32",
        paramList: [
            {
                param: "AllowMultilineFinalElement",
                defaultValue: false,
            }
        ],
        url: "https://docs.rubocop.org/rubocop/1.50/cops_layout.html#layoutmultilinemethodparameterlinebreaks",
    },
    {
        id: "Layout/MultilineOperationIndentation",
        enabled: true,
        descEn: "Checks indentation of binary operations that span more than one line.",
        descCn: "",
        versionAdded: "0.49",
        paramList: [
            {
                param: "EnforcedStyle",
                defaultValue: "aligned",
                optionList: ["aligned", "indented"],
            },
            {
                param: "IndentationWidth",
                defaultValue: null,
                demoValue: 1,
            }
        ],
        url: "https://docs.rubocop.org/rubocop/1.50/cops_layout.html#layoutmultilineoperationindentation",
    },
    {
        id: "Layout/ParameterAlignment",
        enabled: true,
        descEn: "Align the parameters of a method definition if they span more than one line.",
        descCn: "",
        versionAdded: "0.49",
        versionChanged: "0.77",
        paramList: [
            {
                param: "EnforcedStyle",
                defaultValue: "with_first_parameter",
                optionList: ["with_first_parameter", "with_fixed_indentation"],
            },
            {
                param: "IndentationWidth",
                defaultValue: null,
                demoValue: 1,
            }
        ],
        url: "https://docs.rubocop.org/rubocop/1.50/cops_layout.html#layoutparameteralignment",
    },
    {
        id: "Layout/RedundantLineBreak",
        enabled: false,
        descEn: "Do not break up an expression into multiple lines when it fits on a single line.",
        descCn: "",
        versionAdded: "1.13",
        paramList: [
            {
                param: "InspectBlocks",
                defaultValue: false,
            }
        ],
        url: "https://docs.rubocop.org/rubocop/1.50/cops_layout.html#layoutredundantlinebreak",
    },
    {
        id: "Layout/RescueEnsureAlignment",
        enabled: true,
        descEn: "Align rescues and ensures correctly.",
        descCn: "",
        versionAdded: "0.49",
        paramList: [],
        url: "https://docs.rubocop.org/rubocop/1.50/cops_layout.html#layoutrescueensurealignment",
    },
    {
        id: "Layout/SingleLineBlockChain",
        enabled: false,
        descEn: "Put method call on a separate line if chained to a single line block.",
        descCn: "",
        versionAdded: "1.14",
        paramList: [],
        url: "https://docs.rubocop.org/rubocop/1.50/cops_layout.html#layoutsinglelineblockchain",
    },
    {
        id: "Layout/SpaceAfterColon",
        enabled: true,
        descEn: "Use spaces after colons.",
        descCn: "",
        versionAdded: "0.49",
        paramList: [],
        url: "https://docs.rubocop.org/rubocop/1.50/cops_layout.html#layoutspaceaftercolon",
    },
    {
        id: "Layout/SpaceAfterComma",
        enabled: true,
        descEn: "Use spaces after commas.",
        descCn: "",
        versionAdded: "0.49",
        paramList: [],
        url: "https://docs.rubocop.org/rubocop/1.50/cops_layout.html#layoutspaceaftercomma",
    },
    {
        id: "Layout/SpaceAfterMethodName",
        enabled: true,
        descEn: "Do not put a space between a method name and the opening parenthesis in a method definition.",
        descCn: "",
        versionAdded: "0.49",
        paramList: [],
        url: "https://docs.rubocop.org/rubocop/1.50/cops_layout.html#layoutspaceaftermethodname",
    },
    {
        id: "Layout/SpaceAfterNot",
        enabled: true,
        descEn: "Tracks redundant space after the ! operator",
        descCn: "",
        versionAdded: "0.49",
        paramList: [],
        url: "https://docs.rubocop.org/rubocop/1.50/cops_layout.html#layoutspaceafternot",
    },
    {
        id: "Layout/SpaceAfterSemicolon",
        enabled: true,
        descEn: "Use spaces after semicolons.",
        descCn: "",
        versionAdded: "0.49",
        paramList: [],
        url: "https://docs.rubocop.org/rubocop/1.50/cops_layout.html#layoutspaceaftersemicolon",
    },
    {
        id: "Layout/SpaceAroundBlockParameters",
        enabled: true,
        descEn: "Checks the spacing inside and after block parameters pipes",
        descCn: "",
        versionAdded: "0.49",
        paramList: [
            {
                param: "EnforcedStyleInsidePipes",
                defaultValue: "no_space",
                optionList: ["space", "no_space"],
            }
        ],
        url: "https://docs.rubocop.org/rubocop/1.50/cops_layout.html#layoutspacearoundblockparameters",
    },
    {
        id: "Layout/SpaceAroundEqualsInParameterDefault",
        enabled: true,
        descEn: "Checks that the equals signs in parameter default assignments have or don't have surrounding space depending on configuration.",
        descCn: "",
        versionAdded: "0.49",
        paramList: [
            {
                param: "EnforcedStyle",
                defaultValue: "space",
                optionList: ["space", "no_space"],
            }
        ],
        url: "https://docs.rubocop.org/rubocop/1.50/cops_layout.html#layoutspacearoundequalsinparameterdefault",
    },
    {
        id: "Layout/SpaceAroundKeyword",
        enabled: true,
        descEn: "Use a space around keywords if appropriate.",
        descCn: "",
        versionAdded: "0.49",
        paramList: [],
        url: "https://docs.rubocop.org/rubocop/1.50/cops_layout.html#layoutspacearoundkeyword",
    },
    {
        id: "Layout/SpaceAroundMethodCallOperator",
        enabled: true,
        descEn: "Checks method call operators to not have spaces around them.",
        descCn: "",
        versionAdded: "0.82",
        paramList: [],
        url: "https://docs.rubocop.org/rubocop/1.50/cops_layout.html#layoutspacearoundkeyword",
    },
    {
        id: "Layout/SpaceAroundOperators",
        enabled: true,
        descEn: "Use a single space around operators",
        descCn: "",
        versionAdded: "0.49",
        paramList: [
            {
                param: "AllowForAlignment",
                defaultValue: true,
            },
            {
                param: "EnforcedStyleForExponentOperator",
                defaultValue: "no_space",
                optionList: ["space", "no_space"],
            }
        ],
        url: "https://docs.rubocop.org/rubocop/1.50/cops_layout.html#layoutspacearoundkeyword",
    },
    {
        id: "Layout/SpaceBeforeBlockBraces",
        enabled: true,
        descEn: "Checks that the left block brace has or doesn't have space before it.",
        descCn: "",
        versionAdded: "0.49",
        paramList: [
            {
                param: "EnforcedStyle",
                defaultValue: "space",
                optionList: ["space", "no_space"],
            },
            {
                param: "EnforcedStyleForEmptyBraces",
                defaultValue: "space",
                optionList: ["space", "no_space"],
            },
        ],
        url: "https://docs.rubocop.org/rubocop/1.50/cops_layout.html#layoutspacebeforeblockbraces",
    },
    {
        id: "Layout/SpaceBeforeBrackets",
        enabled: "pending",
        descEn: "Checks for receiver with a space before the opening brackets.",
        descCn: "",
        versionAdded: "1.7",
        paramList: [],
        url: "https://docs.rubocop.org/rubocop/1.50/cops_layout.html#layoutspacebeforebrackets",
    },
    {
        id: "Layout/SpaceBeforeComma",
        enabled: true,
        descEn: "No spaces before commas.",
        descCn: "",
        versionAdded: "0.49",
        paramList: [],
        url: "https://docs.rubocop.org/rubocop/1.50/cops_layout.html#layoutspacebeforebrackets",
    },
    {
        id: "Layout/SpaceBeforeComment",
        enabled: true,
        descEn: "Checks for missing space between code and a comment on the same line.",
        descCn: "",
        versionAdded: "0.49",
        paramList: [],
        url: "https://docs.rubocop.org/rubocop/1.50/cops_layout.html#layoutspacebeforebrackets",
    },
    {
        id: "Layout/SpaceBeforeFirstArg",
        enabled: true,
        descEn: "Checks that exactly one space is used between a method name and the first argument for method calls without parentheses.",
        descCn: "",
        versionAdded: "0.49",
        paramList: [
            {
                param: "AllowForAlignment",
                defaultValue: true,
            }
        ],
        url: "https://docs.rubocop.org/rubocop/1.50/cops_layout.html#layoutspacebeforefirstarg",
    },
    {
        id: "Layout/SpaceBeforeSemicolon",
        enabled: true,
        descEn: "No spaces before semicolons",
        descCn: "",
        versionAdded: "0.49",
        paramList: [],
        url: "https://docs.rubocop.org/rubocop/1.50/cops_layout.html#layoutspacebeforesemicolon",
    },
    {
        id: "Layout/SpaceInLambdaLiteral",
        enabled: true,
        descEn: "Checks for spaces in lambda literals.",
        descCn: "",
        versionAdded: "0.49",
        paramList: [
            {
                param: "EnforcedStyle",
                defaultValue: "require_no_space",
                optionList: ["require_no_space", "require_space"],
            },
        ],
        url: "https://docs.rubocop.org/rubocop/1.50/cops_layout.html#layoutspaceinlambdaliteral",
    },
    {
        id: "Layout/SpaceInsideArrayLiteralBrackets",
        enabled: true,
        descEn: "Checks the spacing inside array literal brackets.",
        descCn: "",
        versionAdded: "0.52",
        paramList: [
            {
                param: "EnforcedStyle",
                defaultValue: "no_space",
                optionList: ["space", "no_space", "compact"],
            },
            {
                param: "EnforcedStyleForEmptyBrackets",
                defaultValue: "no_space",
                optionList: ["space", "no_space"],
            }
        ],
        url: "https://docs.rubocop.org/rubocop/1.50/cops_layout.html#layoutspaceinsidearrayliteralbrackets",
    },
    {
        id: "Layout/SpaceInsideArrayPercentLiteral",
        enabled: true,
        descEn: "No unnecessary additional spaces between elements in %i/%w literals.",
        descCn: "",
        versionAdded: "0.49",
        paramList: [],
        url: "https://docs.rubocop.org/rubocop/1.50/cops_layout.html#layoutspaceinsidearraypercentliteral",
    },
    {
        id: "Layout/SpaceInsideBlockBraces",
        enabled: true,
        descEn: "Checks that block braces have or don't have surrounding space.For blocks taking parameters, checks that the left brace has or doesn't have trailing space.",
        descCn: "",
        versionAdded: "0.49",
        paramList: [
            {
                param: "EnforcedStyle",
                defaultValue: "space",
                optionList: ["space", "no_space"],
            },
            {
                param: "EnforcedStyleForEmptyBraces",
                defaultValue: "no_space",
                optionList: ["space", "no_space"],
            },
            {
                param: "SpaceBeforeBlockParameters",
                defaultValue: true,
            }
        ],
        url: "https://docs.rubocop.org/rubocop/1.50/cops_layout.html#layoutspaceinsidearraypercentliteral",
    },
    {
        id: "Layout/SpaceInsideHashLiteralBraces",
        enabled: true,
        descEn: "Use spaces inside hash literal braces - or don't.",
        descCn: "",
        versionAdded: "0.49",
        paramList: [
            {
                param: "EnforcedStyle",
                defaultValue: "space",
                optionList: ["space", "no_space", "compact"],
            },
            {
                param: "EnforcedStyleForEmptyBraces",
                defaultValue: "no_space",
                optionList: ["space", "no_space"],
            }
        ],
        url: "https://docs.rubocop.org/rubocop/1.50/cops_layout.html#layoutspaceinsidehashliteralbraces",
    },
    {
        id: "Layout/SpaceInsideParens",
        enabled: true,
        descEn: "No spaces after ( or before ).",
        descCn: "",
        versionAdded: "0.49",
        versionChanged: "1.22",
        paramList: [
            {
                param: "EnforcedStyle",
                defaultValue: "no_space",
                optionList: ["space", "compact", "no_space"],
            }
        ],
        url: "https://docs.rubocop.org/rubocop/1.50/cops_layout.html#layoutspaceinsideparens",
    },
    {
        id: "Layout/SpaceInsidePercentLiteralDelimiters",
        enabled: true,
        descEn: "No unnecessary spaces inside delimiters of %i/%w/%x literals.",
        descCn: "",
        versionAdded: "0.49",
        paramList: [],
        url: "https://docs.rubocop.org/rubocop/1.50/cops_layout.html#layoutspaceinsidepercentliteraldelimiters",
    },
    {
        id: "Layout/SpaceInsideRangeLiteral",
        enabled: true,
        descEn: "No spaces inside range literals.",
        descCn: "",
        versionAdded: "0.49",
        paramList: [],
        url: "https://docs.rubocop.org/rubocop/1.50/cops_layout.html#layoutspaceinsiderangeliteral",
    },
    {
        id: "Layout/SpaceInsideReferenceBrackets",
        enabled: true,
        descEn: "Checks the spacing inside referential brackets.",
        descCn: "",
        versionAdded: "0.52",
        versionChanged: "0.53",
        paramList: [
            {
                param: "EnforcedStyle",
                defaultValue: "no_space",
                optionList: ["space", "no_space"],
            },
            {
                param: "EnforcedStyleForEmptyBrackets",
                defaultValue: "no_space",
                optionList: ["space", "no_space"],
            },
        ],
        url: "https://docs.rubocop.org/rubocop/1.50/cops_layout.html#layoutspaceinsidereferencebrackets",
    },
    {
        id: "Layout/SpaceInsideStringInterpolation",
        enabled: true,
        descEn: "Checks for padding/surrounding spaces inside string interpolation.",
        descCn: "",
        versionAdded: "0.49",
        paramList: [
            {
                param: "EnforcedStyle",
                defaultValue: "no_space",
                optionList: ["space", "no_space"],
            }
        ],
        url: "https://docs.rubocop.org/rubocop/1.50/cops_layout.html#layoutspaceinsidestringinterpolation",
    },
    {
        id: "Layout/TrailingEmptyLines",
        enabled: true,
        descEn: "Checks trailing blank lines and final newline.",
        descCn: "",
        versionAdded: "0.49",
        versionChanged: "0.77",
        paramList: [
            {
                param: "EnforcedStyle",
                defaultValue: "final_newline",
                optionList: ["final_newline", "final_blank_line"],
            }
        ],
        url: "https://docs.rubocop.org/rubocop/1.50/cops_layout.html#layouttrailingemptylines",
    },
    {
        id: "Layout/TrailingWhitespace",
        enabled: true,
        descEn: "Avoid trailing whitespace.",
        descCn: "",
        versionAdded: "0.49",
        versionChanged: "1.0",
        paramList: [
            {
                param: "AllowInHeredoc",
                defaultValue: false,
            }
        ],
        url: "https://docs.rubocop.org/rubocop/1.50/cops_layout.html#layouttrailingwhitespace",
    },
]